﻿#include <iostream>
#include <algorithm>

using namespace std;
const int N = 110, M = 2e4 + 10;
int s, n, m;
int a[N][N];
int f[M];
int main()
{
	cin >> s >> n >> m;
	for (int i = 1; i <= s; i++)
	{
		for (int j = 1; j <= n; j++)
		{
			cin >> a[j][i]; // 翻转⼀下
			// ⼩贪⼼
			a[j][i] = a[j][i] * 2 + 1;
		}
	}
	// 把每⼀⾏排序
	for (int i = 1; i <= n; i++)
	{
		sort(a[i] + 1, a[i] + 1 + s);
	}
	for (int i = 1; i <= n; i++)
	{
		for (int j = m; j >= a[i][1]; j--)
		{
			for (int k = 1; k <= s&&a[i][k] <= j; k++)
			{
				f[j] = max(f[j], f[j - a[i][k]] + k * i);
			}
		}
	}
	cout << f[m] << endl;
	return 0;
}